<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>mtlb_triu</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>M2SCI function</center>
    <div align="right">Last update : 09/04/2004</div>
    <p>
      <b>mtlb_triu</b> - Matlab triu emulation function</p>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>Matlab and Scilab <tt>
        <b>triu</b>
      </tt> behave differently in some particular cases:</p>
    <dl>
      <dd>
        <b></b>
        <dd>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        With complex input: Matlab <tt>
              <b>triu</b>
            </tt> can be used with complex data but not Scilab one.
        </li>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        With character strings inputs: due to the fact the Matlab and Scilab do not consider character
	strings in the same way, Scilab and Matlab <tt>
              <b>triu</b>
            </tt> do not give the same results
	for this type of input.
        </li>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        With boolean inputs: Matlab <tt>
              <b>triu</b>
            </tt> can be used with boobean data but not Scilab one.
        </li>
        </dd>
      </dd>
    </dl>
    <p>
    The function <tt>
        <b>mtlb_triu(x,k)</b>
      </tt> is used by
    <tt>
        <b>mfile2sci</b>
      </tt> to replace <tt>
        <b>triu(x,k)</b>
      </tt> when it was not
    possible to know what were the inputs while porting Matlab code to Scilab. This function will
    determine the correct semantic at run time. If you want to have a
    more efficient code it is possible to replace <tt>
        <b>mtlb_triu</b>
      </tt> calls:
    </p>
    <dl>
      <dd>
        <b></b>
        <dd>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        If <tt>
              <b>X</b>
            </tt> contains real double values
        <tt>
              <b>mtlb_triu(x,k)</b>
            </tt> may be replaced by <tt>
              <b>triu(x,k)</b>
            </tt>
          </li>
          <li>
            <b>
              <font color="maroon"></font>
            </b>
        If <tt>
              <b>X</b>
            </tt> contains boolean values
        <tt>
              <b>mtlb_triu(x,k)</b>
            </tt> may be replaced by <tt>
              <b>triu(bool2s(x),k)</b>
            </tt>
          </li>
        </dd>
      </dd>
    </dl>
    <p>Caution: <tt>
        <b>mtlb_triu</b>
      </tt> has not to be used for hand coded functions.</p>
    <h3>
      <font color="blue">See Also</font>
    </h3>
    <p>
      <a href="Matlab-Scilab_character_strings.htm">
        <tt>
          <b>Matlab-Scilab_character_strings</b>
        </tt>
      </a>,&nbsp;&nbsp;</p>
    <h3>
      <font color="blue">Authors</font>
    </h3>
    <dl>
      <dd>
        <b></b>V.C.</dd>
    </dl>
  </body>
</html>
